#!/bin/ksh

# This is the script used to start the Virtual Terminal

unset ENV
OS=`/bin/uname -s`

if [ "$OS" = "Linux" ] ; then
   export LD_LIBRARY_PATH=/usr/lib::$LD_LIBRARY_PATH
   export PATH=/opt/IBMJava2-13/jre/bin:$PATH
   export ASSUME_LD_KERNEL=2.2.5
else
   export PATH=/usr/java131/bin:/usr/java131/jre/bin:$PATH
fi

x=/usr/websm/codebase/wsm.jar:/usr/websm/codebase/habeans.jar:/usr/websm/codebase/hatrace.jar:

for i in `ls /usr/websm/codebase/pluginjars/*.jar 2>/dev/null`
do
  x=$x$i:
done

if [ "$OS" = "Linux" ] ; then
  export CLASSPATH=/opt/hsc:/usr/websm/codebase:$x
else
  export CLASSPATH=/usr/websm/codebase:$x
fi

VXTERM=

if [ -x /opt/hsc/bin/vxterm ] 
then
	VXTERM=/opt/hsc/bin/vxterm
elif [ -x /usr/websm/bin/vxterm ] 
then
	VXTERM=/usr/websm/bin/vxterm
fi

if [ "$VXTERM" != ""  ]
then
  xterm -sl 500 -T "VTERM:   $5       $3" -e $VXTERM "$1" "$2" "$3" "$4" "$5"  >/dev/null 2>&1
else
  nohup java com.ibm.hsc.vterm.VconsTerminal "$1" "$2" "$3" "$4" "$5" >/dev/null 2>&1 
fi

sleep 2
